﻿import QtQuick 2.14

Rectangle{
    id:controlRoot

    property string titleText:"年度订单总量"
    property int    titleTextSize:20
    property color  titleTextColor:"#949494"
    property var    titleTextAlign:Text.AlignLeft
    property bool   titleDividerVisible:false

    property color  axisLineColor:viewBorderColor
    property color  axisGridColor:viewBorderColor
    property color  axisLabelTextColor:titleTextColor
    property int    axisLabelTextSize:13
    property bool   xAxisGridVisible:false
    property bool   yAxisGridVisible:true

    property color  viewBackColor:"white"
    property color  viewBorderColor:"#CFCFCF"

    width:400
    height:400
    color:viewBackColor
    border.color: viewBorderColor
    radius: 5

    Rectangle{
        id:titleBack
        width: parent.width
        height: titleTextSize*2
        border.color: viewBorderColor
        gradient: Gradient{
            GradientStop { position: 0.0; color: "#FBFBFB" }
            GradientStop { position: 0.5; color: "#F0F0F0" }
            GradientStop { position: 1.0; color: "#E8E8E8" }
        }

        Text {
            text: titleText
            anchors.fill: parent
            horizontalAlignment: titleTextAlign
            verticalAlignment: Text.AlignVCenter
            font.pixelSize: titleTextSize
            color: titleTextColor
            leftPadding: horizontalAlignment==Text.AlignHCenter?0:10
        }

        Rectangle{
            color: viewBorderColor
            width: parent.width
            height: 1
            anchors.bottom: parent.bottom
            visible: titleDividerVisible
        }
    }
}
